import { EventTarget as ot, Node as Vt, Link as en, Rectangle as nn, EventBase as qe, setProto as R, RegSystem as N, AENode as Zt, Animation as P, Shape as sn, AnchorUsageType as rn, ImageNode as on } from "@jtopo/core";
const mt = et;
function et(n, t) {
  const e = Jt();
  return (et = function(i, r) {
    return e[i -= 296];
  })(n, t);
}
function Jt() {
  const n = ["2379564TaAxPc", "3611258FBxPWr", "domElement", "hide", "div", "remove", "innerHTML", "8brixic", "initEvent", "52VJaRPC", "1471035qRTsYy", "style", "133970uGcTXg", "stage", "height", "classList", "236664BMAiUN", "top", "left", "dispatchEvent", "appendChild", "123086hUaUcX", "defaultPrevented", "72516DJmRgb"];
  return (Jt = function() {
    return n;
  })();
}
(function() {
  const n = et, t = Jt();
  for (; ; )
    try {
      if (-parseInt(n(309)) / 1 + parseInt(n(300)) / 2 + parseInt(n(311)) / 3 * (-parseInt(n(297)) / 4) + -parseInt(n(298)) / 5 + parseInt(n(312)) / 6 + parseInt(n(313)) / 7 * (parseInt(n(319)) / 8) + parseInt(n(304)) / 9 === 274240)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Bn extends ot {
  constructor(t, e) {
    const i = et;
    super(), this[i(301)] = t, this.domElement = this.setHtml(e);
  }
  [mt(317)]() {
    const t = mt;
    this[t(314)] != null && this.domElement[t(317)]();
  }
  setHtml(t) {
    const e = mt;
    this.html = t, this.remove();
    let i = document.createElement(e(316));
    return i[e(303)].add("jtopo_popoupmenu"), this.stage.uiContainer[e(308)](i), i[e(318)] = t, this[e(296)](i), this[e(314)] = i, this[e(315)](), i;
  }
  initEvent(t) {
    let e = this;
    t.querySelectorAll("a").forEach(function(i) {
      i.addEventListener("click", function(r) {
        const s = et;
        let l = new Event("select", { cancelable: !0 });
        l.item = this.innerHTML, e[s(307)](l), l[s(310)] || e[s(315)]();
      });
    });
  }
  showAt(t, e) {
    const i = mt;
    let r = this[i(314)], s = this[i(301)];
    r[i(299)].display = "block", e + r.offsetHeight >= s.height && e > s[i(302)] / 2 && (e -= r.offsetHeight), t + r.offsetWidth >= s.width && t > s.width / 2 && (t -= r.offsetWidth), r[i(299)][i(306)] = t + "px", r[i(299)][i(305)] = e + "px";
  }
  hide() {
    this.domElement.style.display = "none";
  }
}
const yt = nt;
function Xt() {
  const n = ["2439FavYAr", "style", "64687lllMWR", "opacity", "154TNkUaV", "290AAZbQe", "425784rAVnOH", "51222ORoSMz", "1687648ZwbgTP", "stage", "pointermove", "initEvent", "91qCVIur", "transition", "fadeOut", "addEventListener", "domElement", "div", "classList", "display", "3231025htmuOH", "257220wfqaZs", "setHtml"];
  return (Xt = function() {
    return n;
  })();
}
(function() {
  const n = nt, t = Xt();
  for (; ; )
    try {
      if (parseInt(n(402)) / 1 + -parseInt(n(404)) / 2 * (parseInt(n(400)) / 3) + parseInt(n(408)) / 4 + -parseInt(n(397)) / 5 + parseInt(n(407)) / 6 * (-parseInt(n(412)) / 7) + -parseInt(n(406)) / 8 + -parseInt(n(398)) / 9 * (-parseInt(n(405)) / 10) === 442409)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Hn extends ot {
  constructor(t) {
    const e = nt;
    super(), this.stage = t, this.domElement = document.createElement(e(417)), this.domElement[e(395)].add("jtopo_tooltip"), this.domElement[e(401)][e(413)] = "opacity 1s ease-in-out", this.stage.uiContainer.appendChild(this.domElement), this[e(411)](), this.fadeOut();
  }
  disable() {
    this.domElement && this.domElement.remove();
  }
  enabled() {
    this.domElement && this.domElement.parentNode == null && this.stage.uiContainer.appendChild(this.domElement);
  }
  [yt(399)](t) {
    const e = yt;
    return this[e(416)].innerHTML = t, this[e(416)];
  }
  initEvent() {
    const t = yt, e = this, i = this[t(409)].inputSystem;
    i[t(415)]("pointerdown", function() {
      e[t(414)]();
    }), i.addEventListener("pointerup", function() {
      e[t(414)]();
    }), i[t(415)](t(410), function() {
      i.mouseoverTarget == null && e.fadeOut();
    });
  }
  showAt(t, e) {
    const i = yt;
    this.domElement.style.display = "block", this[i(416)][i(401)].left = t + "px", this.domElement.style.top = e + "px", requestAnimationFrame(() => {
      const r = i;
      this.domElement[r(401)][r(403)] = "1";
    });
  }
  fadeOut() {
    this.domElement.style.opacity = "0", setTimeout(() => {
      const t = nt;
      this.domElement.style.opacity === "0" && (this.domElement.style[t(396)] = "none");
    }, 100);
  }
}
function nt(n, t) {
  const e = Xt();
  return (nt = function(i, r) {
    return e[i -= 395];
  })(n, t);
}
(function() {
  const n = Qt, t = Kt();
  for (; ; )
    try {
      if (parseInt(n(263)) / 1 * (parseInt(n(260)) / 2) + parseInt(n(258)) / 3 * (parseInt(n(254)) / 4) + -parseInt(n(264)) / 5 * (parseInt(n(265)) / 6) + parseInt(n(257)) / 7 + -parseInt(n(256)) / 8 + -parseInt(n(259)) / 9 * (parseInt(n(255)) / 10) + parseInt(n(261)) / 11 * (parseInt(n(262)) / 12) === 165227)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let Ue = document.createElement("div");
Ue.innerHTML = `
<svg viewBox="0 0 24 24" id="zoom-in">
<path d="M4,20 L9.58788778,14.4121122"/>
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M14 7.33333333L14 12.6666667"/>
</svg>
<svg viewBox="0 0 24 24" id="zoom-out">
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M4 20L9.58788778 14.4121122"/>
</svg>
<svg viewBox="0 0 24 24" id="back-left">
<path d="M5,17 L5,15 C5,10.0294373 8.80557963,6 13.5,6 C18.1944204,6 22,10.0294373 22,15"/>
<polyline points="8 15 5 18 2 15"/>
</svg>
<svg viewBox="0 0 24 24" id="align-center">
<path d="M8 10L16 10M6 6L18 6M6 14L18 14M8 18L16 18"/>
</svg>
<svg viewBox="0 0 24 24" id="edit">
<path d="M18.4142136 4.41421356L19.5857864 5.58578644C20.366835 6.36683502 20.366835 7.63316498 19.5857864 8.41421356L8 20 4 20 4 16 15.5857864 4.41421356C16.366835 3.63316498 17.633165 3.63316498 18.4142136 4.41421356zM14 6L18 10"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-alt">
<rect width="14" height="10" x="5" y="11"/>
<path d="M12,3 L12,3 C14.7614237,3 17,5.23857625 17,8 L17,11 L7,11 L7,8 C7,5.23857625 9.23857625,3 12,3 Z"/>
<circle cx="12" cy="16" r="1"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-open">
<path d="M7,7.625 L7,7 C7,4.23857625 9.23857625,2 12,2 L12,2 C14.7614237,2 17,4.23857625 17,7 L17,11"/>
<rect width="14" height="10" x="5" y="11"/>
</svg>
<svg viewBox="0 0 24 24" id="pan">
<path d="M20,14 L20,17 C20,19.209139 18.209139,21 16,21 L10.0216594,21 C8.75045497,21 7.55493392,20.3957659 6.80103128,19.3722467 L3.34541668,14.6808081 C2.81508416,13.9608139 2.94777982,12.950548 3.64605479,12.391928 C4.35756041,11.8227235 5.38335813,11.8798792 6.02722571,12.5246028 L8,14.5 L8,13 L8.00393081,13 L8,11 L8.0174523,6.5 C8.0174523,5.67157288 8.68902517,5 9.5174523,5 C10.3458794,5 11.0174523,5.67157288 11.0174523,6.5 L11.0174523,11 L11.0174523,4.5 C11.0174523,3.67157288 11.6890252,3 12.5174523,3 C13.3458794,3 14.0174523,3.67157288 14.0174523,4.5 L14.0174523,11 L14.0174523,5.5 C14.0174523,4.67157288 14.6890252,4 15.5174523,4 C16.3458794,4 17.0174523,4.67157288 17.0174523,5.5 L17.0174523,11 L17.0174523,7.5 C17.0174523,6.67157288 17.6890252,6 18.5174523,6 C19.3458794,6 20.0174523,6.67157288 20.0174523,7.5 L20.0058962,14 L20,14 Z"/>
</svg>
<svg viewBox="0 0 24 24" id="apps-alt">
<rect x="5" y="5" width="2" height="2"/>
<rect x="11" y="5" width="2" height="2"/>
<rect x="17" y="5" width="2" height="2"/>
<rect x="5" y="11" width="2" height="2"/>
<rect x="11" y="11" width="2" height="2"/>
<rect x="17" y="11" width="2" height="2"/>
<rect x="5" y="17" width="2" height="2"/>
<rect x="11" y="17" width="2" height="2"/>
<rect x="17" y="17" width="2" height="2"/>
</svg>
<svg viewBox="0 0 24 24" id="maximise">
<polyline points="21 16 21 21 16 21"/>
<polyline points="8 21 3 21 3 16"/>
<polyline points="16 3 21 3 21 8"/>
<polyline points="3 8 3 3 8 3"/>
</svg>
<svg viewBox="0 0 24 24" id="minimise">
<polyline points="8 3 8 8 3 8"/>
<polyline points="21 8 16 8 16 3"/>
<polyline points="3 16 8 16 8 21"/>
<polyline points="16 21 16 16 21 16"/>
</svg>
<svg viewBox="0 0 24 24" id="download">
<path d="M12,3 L12,16"/>
<polyline points="7 12 12 17 17 12"/>
<path d="M20,21 L4,21"/>
</svg>
<svg viewBox="0 0 24 24" id="rectangle">
<rect width="18" height="18" x="3" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="cursor">
<polygon points="7 20 7 4 19 16 12 16 7 21"/>
</svg>
<svg viewBox="0 0 24 24" id="search">
<path d="M14.4121122,14.4121122 L20,20"/>
<circle cx="10" cy="10" r="6"/>
</svg>
<svg viewBox="0 0 24 24" id="eye">
<path d="M22 12C22 12 19 18 12 18C5 18 2 12 2 12C2 12 5 6 12 6C19 6 22 12 22 12Z"/>
<circle cx="12" cy="12" r="3"/>
</svg>
<svg viewBox="0 0 24 24" id="save">
<path d="M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z"/>
<rect width="10" height="8" x="7" y="13"/>
<rect width="8" height="5" x="8" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="image">
<rect width="18" height="18" x="3" y="3"/>
<path stroke-linecap="round" d="M3 14l4-4 11 11"/>
<circle cx="13.5" cy="7.5" r="2.5"/>
<path stroke-linecap="round" d="M13.5 16.5L21 9"/>
</svg>
<svg viewBox="0 0 24 24" id="upload">
<path d="M12,4 L12,17"/>
<polyline points="7 8 12 3 17 8"/>
<path d="M20,21 L4,21"/>
</svg>
`;
let Yt = {};
function Qt(n, t) {
  const e = Kt();
  return (Qt = function(i, r) {
    return e[i -= 253];
  })(n, t);
}
function Kt() {
  const n = ["1557RIrdKd", "173278hQsUZD", "8239PQnMIx", "4908wnlIRS", "2qTddIb", "317105ixwQED", "18SnCygv", "querySelector", "8iPyMBL", "13490hhTJsX", "1025072PXAxVf", "34566NHfDjx", "348666lZSCrN"];
  return (Kt = function() {
    return n;
  })();
}
Yt.get = function(n) {
  return Ue[Qt(253)]("#" + n);
};
const x = vt;
function $t() {
  const n = ["imageToBase64", `</button>
<button title="框选模式" class="item" group='mode' iconId='rectangle'>`, "639yAidZn", "1799892kVktGq", "zoomToFit", "setMode", "overview", `</button>
<button title="取消缩放" class="item" iconId='back-left'>`, "fromJSON", "active", "querySelector", ".json", "zoom", "lock-alt", `</button>
<button title="居中" class="item" iconId='align-center'>`, "edit", "saveImageInfo", "pan", "9896UVhlGb", 'input[type="text"]', "zoom-out", "fullWindow", "querySelectorAll", "download", "600lzescF", "effectSystem", `</button>
<button title="缩小"  class="item" iconId='zoom-out'>`, "2076ExasHE", "name", "value", "要保存的文件名：", `</button>
</div>
<div class="group">
<button title="放大"  class="item" iconId='zoom-in'>`, "get", "248154fZRrvU", `</button>
</div>
<div class="group">
<button title="缩略图" class="item" iconId='eye'>`, "activeButton", "camera", "view", "5405kaIHtu", "fileInput", "75132nijBVu", "domObj", "1615789xHskhR", "flash", "align-center", "click", "77330ZLwylg", "1NPEvnQ", `</button>
<button title="编辑模式" edit="true" class="item" group='mode' iconId='edit' style="display:none">`, "lookAtObject", 'button[title="', "style", "length", "display", "buttons", "remove", "2899daaFZG", "outerHTML", "div", "3YyrofI", '<input type="file"/>', "stringify", "group"];
  return ($t = function() {
    return n;
  })();
}
function b(n) {
  const t = vt;
  return Yt.get(n)[t(158)];
}
function vt(n, t) {
  const e = $t();
  return (vt = function(i, r) {
    return e[i -= 111];
  })(n, t);
}
(function() {
  const n = vt, t = $t();
  for (; ; )
    try {
      if (-parseInt(n(148)) / 1 * (parseInt(n(134)) / 2) + parseInt(n(160)) / 3 * (-parseInt(n(167)) / 4) + parseInt(n(139)) / 5 * (parseInt(n(128)) / 6) + -parseInt(n(143)) / 7 + parseInt(n(119)) / 8 * (-parseInt(n(166)) / 9) + parseInt(n(125)) / 10 * (-parseInt(n(147)) / 11) + parseInt(n(141)) / 12 * (parseInt(n(157)) / 13) === 455725)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let an = `
<div class="group">
<button title="默认" class="item active" group='mode' iconId='cursor'>` + b("cursor") + x(149) + b(x(116)) + x(165) + b("rectangle") + `</button>
<button title="拖拽模式"  class="item" group='mode' iconId='pan'>` + b(x(118)) + `</button>
<button title="锁定模式" class="item" group='mode' iconId='lock-alt'>` + b(x(114)) + x(132) + b("zoom-in") + x(127) + b(x(121)) + x(115) + b(x(145)) + `</button>
<button title="缩放至画布" class="item" iconId='minimise'>` + b("minimise") + x(171) + b("back-left") + x(135) + b("eye") + `</button>
<button title="浏览器全屏" class="item" iconId='maximise'>` + b("maximise") + `</button>
<input title="查找" type="text" placeholder="查找" value=""></input>
<button class="item" iconId='search'>` + Yt[x(133)]("search").outerHTML + `</button>
</div>
<div class="group">
<button title="导出PNG" class="item" iconId='image'>` + b("image") + `</button>
<button title="打开本地文件" class="item" iconId='upload'>` + b("upload") + `</button>
<button title="保存到本地" class="item" iconId='save'>` + b("save") + `</button>
<div style="display:none;"><input type="file"/></div>
</div>
`;
class Rn {
  constructor(t) {
    this[x(164)] = !0, this.stage = t, this.initToolbar(t, an), t.domElement.prepend(this.getDom());
    let e = this;
    setTimeout(function() {
      e.initActiveStatus();
    }, 200);
  }
  showButton(t) {
    const e = x;
    let i = this.domObj[e(111)](e(151) + t + '"]');
    i != null && (i.style.display = "block");
  }
  hideButton(t) {
    const e = x;
    let i = this[e(142)].querySelector(e(151) + t + '"]');
    i != null && (i[e(152)].display = "none");
  }
  getDom() {
    return this[x(142)];
  }
  show() {
    const t = x;
    this.domObj.style[t(154)] = "block";
  }
  hide() {
    const t = x;
    this.domObj.style[t(154)] = "none";
  }
  [x(156)]() {
    this.domObj.remove();
  }
  initActiveStatus() {
    const t = x;
    if (this.stage.mode == "edit") {
      let e = document.querySelector("button[iconid='edit']");
      this[t(136)](e);
    }
  }
  initToolbar(t, e) {
    const i = x;
    let r = this, s = document.createElement(i(159));
    this.domObj = s, s.classList.add("jtopo_toolbar"), s.innerHTML = e;
    let l = s[i(123)]("button");
    this.buttons = l;
    let o = s[i(111)]('input[type="file"]'), h = o.parentNode;
    function a(d) {
      const g = i;
      h.innerHTML = g(161), c();
      let y = d.target.files[0];
      const k = new FileReader();
      k.readAsText(y), k.onload = function() {
        const I = g;
        try {
          const W = JSON.parse(this.result);
          r.stage[I(172)](W).then(() => {
            const Z = I;
            document.title = y[Z(129)];
          });
        } catch (W) {
          console.log(W), alert("加载出现错误");
        }
      };
    }
    function c() {
      o = s.querySelector('input[type="file"]'), o.addEventListener("change", a);
    }
    function u() {
      const d = i;
      let g = t.getCurrentLayer(), y = s.querySelector(d(120))[d(130)];
      if (y.length > 0) {
        let k = g.querySelector(function(I) {
          return I.text != null && I.text.indexOf(y) != -1;
        });
        k && (t.camera[d(150)](k), t[d(126)][d(144)](k).play());
      }
    }
    c(), this[i(140)] = o;
    let f = { cursor: function() {
      t[i(169)]("normal");
    }, rectangle: function() {
      t[i(169)]("select");
    }, pan: function() {
      t.setMode("drag");
    }, edit: function() {
      t[i(169)]("edit");
    }, "lock-alt": function() {
      const d = i;
      t.setMode(d(138));
    }, eye: function() {
      const d = i;
      t.overview == null || t[d(170)].visible == 0 ? t.showOverview() : t.hideOverview();
    }, "zoom-in": function() {
      t.camera.zoomIn();
    }, "zoom-out": function() {
      t.camera.zoomOut();
    }, "back-left": function() {
      const d = i;
      t.camera.lookAt(0, 0), t.camera[d(113)](1);
    }, minimise: function() {
      const d = i;
      t.camera[d(168)]();
    }, "align-center": function() {
      t[i(137)].lookAtContentCenter();
    }, maximise: function() {
      t[i(122)]();
    }, image: function() {
      t[i(117)]();
    }, save: async function() {
      const d = i;
      let g = prompt(d(131)), y = r.imageToBase64;
      if (g != null)
        if (y)
          t.toJSONWithBase64().then((k) => {
            let I = JSON.stringify(k);
            t.download(g + ".json", I);
          });
        else {
          let k = t.toJSON(), I = JSON[d(162)](k);
          t[d(124)](g + d(112), I);
        }
    }, upload: function() {
      o[i(146)]();
    }, search: u };
    function p(d) {
      d.onclick = function() {
        let g = d.getAttribute("iconId");
        f[g](), r.activeButton(d);
      };
    }
    s[i(111)]("input").onkeydown = function(d) {
      d.key == "Enter" && u();
    };
    for (let d = 0; d < l.length; d++)
      p(l[d]);
  }
  activeButton(t) {
    const e = x;
    let i = t;
    typeof t == "string" && (i = this.domObj.querySelector('button[title="' + t + '"]'));
    let r = i.getAttribute(e(163));
    r != null && (this.removeAllActive(r), i.classList.add(e(173)));
  }
  removeAllActive(t) {
    const e = x;
    let i = this[e(155)];
    for (let r = 0; r < i[e(153)]; r++) {
      let s = i[r];
      t == s.getAttribute("group") && s.classList.remove("active");
    }
  }
}
const w = It;
function It(n, t) {
  const e = te();
  return (It = function(i, r) {
    return e[i -= 183];
  })(n, t);
}
function te() {
  const n = ["pointerHandler", "bind", "inputHandler", "block", "fontSize", "stage", "fontWeight", "139398pobkvj", "target", "dblclickHandler", "540biJgcY", "10182EdNgpg", "45136HQSybA", "oninput", "createMeasurementSpan", "addEventListener", "attachTo", "height", "5jUIwsi", "adjustTextareaWidth", "measurementSpan", "max", "14jrPyUZ", "fontFamily", "style", "camera", "top", "appendChild", "selectionEnd", "docPointdownHandler", "15282NZbwSJ", "dblclick", "disabled", "cancel", "getLabel", "confirm", "show", "hide", "substring", "width", "value", "removeEventListener", "187337UjLRRW", "inputSystem", "zoomHandler", "add", "localToWorldXY", "314064KajPCm", "pointerupHandler", "display", "auto", "scrollHeight", "uiContainer", "121972goAlFX", "textarea", "textY", "setValue", "selectionStart", "pre-wrap", "pointerdown", "toScreenRect"];
  return (te = function() {
    return n;
  })();
}
(function() {
  const n = It, t = te();
  for (; ; )
    try {
      if (parseInt(n(191)) / 1 + parseInt(n(232)) / 2 * (-parseInt(n(221)) / 3) + parseInt(n(202)) / 4 + -parseInt(n(228)) / 5 * (parseInt(n(217)) / 6) + -parseInt(n(222)) / 7 + parseInt(n(196)) / 8 + parseInt(n(240)) / 9 * (-parseInt(n(220)) / 10) === 111957)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Ne extends qe {
  constructor(t, e) {
    super(t, e);
  }
}
class Wn extends ot {
  constructor(t) {
    const e = It;
    super(), this.disabled = !1, this.enabledModes = ["edit"], this[e(215)] = t;
    let i = document.createElement("textarea");
    i.classList.add("jtopo_input_textfield"), this.stage.uiContainer[e(237)](i), this[e(230)] = this.createMeasurementSpan();
    let r = this;
    i.onkeydown = function(s) {
      r.onkeydown(s);
    }, i.oninput = function(s) {
      r.inputHandler(s);
    }, this.textarea = i, t.inputSystem.addEventListener(e(241), this.dblclickHandler.bind(this)), t[e(192)][e(225)]("pointerdown", this.pointerdownHandler[e(211)](this)), t[e(192)][e(225)]("pointerup", this[e(197)].bind(this)), t[e(192)][e(225)]("pointermove", this.pointerHandler.bind(this)), document.addEventListener("pointerdown", this[e(239)].bind(this)), t[e(235)][e(225)]("zoom", this.zoomHandler.bind(this));
  }
  [w(193)](t) {
    this[w(186)]();
  }
  [w(239)](t) {
    let e = t.target;
    e != null ? e !== this.textarea && this.hide() : this.hide();
  }
  [w(212)](t) {
    const e = w;
    this.target != null && this[e(229)]();
  }
  [w(224)]() {
    const t = w;
    let e = document.createElement("span");
    return e.classList[t(194)]("jtopo_measurement_span"), e.style.visibility = "hidden", e[t(234)].position = "absolute", e.style.whiteSpace = t(207), e.style.wordWrap = "none", e.style[t(198)] = "inline-block", e[t(234)].minWidth = "10px", this[t(215)][t(201)].appendChild(e), e;
  }
  [w(219)](t) {
    const e = w;
    if (this[e(242)] || this.enabledModes.indexOf(this.stage.mode) == -1)
      return;
    let i = this.stage[e(192)].target;
    i != null ? this.attachTo(i) : this.cancel();
  }
  pointerHandler(t) {
    this.stage.inputSystem.isPointerDown && this.cancel();
  }
  pointerdownHandler(t) {
    this.stage.inputSystem.target == null && this.cancel();
  }
  pointerupHandler(t) {
    const e = w;
    this.stage.inputSystem[e(218)] == null && this.cancel();
  }
  [w(226)](t) {
    const e = w;
    let i;
    if (this[e(186)](), this.target = t, t instanceof Vt ? i = t : t instanceof en && (i = t[e(183)]()), i == null)
      return;
    let r = new nn(0, 0, i._textWidth, i._textHeight), s = this.stage[e(235)][e(209)](r), l = i.getComputedStyle(), o = parseInt(l[e(214)]) * this.stage.camera.scale;
    this.textarea.style.fontFamily = l[e(233)], this[e(203)].style[e(216)] = l.fontWeight, this.textarea.style.fontSize = o + "px", this.measurementSpan.style.fontFamily = l.fontFamily, this.measurementSpan[e(234)][e(216)] = l[e(216)], this.measurementSpan.style.fontSize = o + "px";
    let h = l.textAlign, a = l.textBaseline, c = i._textPosition, u = i[e(195)](c.x, c.y), f = this.stage[e(235)].toScreenXY(u.x, u.y), p = Math.max(s[e(188)], 30), d = Math[e(231)](s[e(227)], 20), g = f.x - p / 2, y = f.y - d / 2;
    h == "left" ? g = f.x - p / 2 : h == "right" && (g = f.x + p / 2), a == "top" ? y = f.y - d / 2 : a == "bottom" && (y = f.y + d / 2), this.textX = g, this[e(204)] = y, this[e(205)](i.text), this[e(185)]();
  }
  setValue(t) {
    const e = w;
    this.textarea.value = t, this[e(229)]();
  }
  show() {
    const t = w;
    this.textarea.style.display = t(213), this.textarea.focus(), this.textarea.select(), this.textarea.style.left = this.textX + "px", this.textarea.style[t(236)] = this.textY + "px", this.adjustTextareaWidth();
  }
  hide() {
    this.textarea.style.display = "none";
  }
  onkeydown(t) {
    const e = w;
    if (t.key != "Escape") {
      if (t.key == "Enter") {
        if (t.ctrlKey) {
          const i = this.textarea, r = i.selectionStart, s = i.selectionEnd;
          i.value = i.value.substring(0, r) + `
` + i.value[e(187)](s), i[e(206)] = i[e(238)] = r + 1, this.adjustTextareaWidth();
        } else {
          if (this.target == null)
            return;
          this.applyInput();
        }
        t.preventDefault();
      }
    } else
      this.cancel();
  }
  applyInput() {
    const t = w;
    let e = this.target;
    if (e == null)
      return;
    const i = this.textarea;
    let r = new Ne(t(184), { target: e, text: i[t(189)] });
    this.dispatchEvent(r), this.hide(), r.defaultPrevented || (e.text = i[t(189)]);
  }
  [w(243)]() {
    let t = this.target;
    t != null && (this.hide(), this.dispatchEvent(new Ne("cancel", { target: t })));
  }
  adjustTextareaWidth() {
    const t = w;
    let e = this[t(230)];
    e.textContent = this[t(203)].value;
    const i = e.offsetWidth + 10;
    this.textarea.style.width = i + "px", this.textarea.style.height = t(199), this.textarea.style.height = this[t(203)][t(200)] + "px";
  }
  destroy() {
    const t = w;
    this.textarea.onkeydown = null, this.textarea[t(223)] = null, document[t(190)](t(208), this.docPointdownHandler), this.removeEventListener("dblclick", this.dblclickHandler), this.removeEventListener(t(208), this.pointerdownHandler), this[t(190)]("pointerup", this.pointerupHandler), this.removeEventListener("pointermove", this[t(210)]), this.textarea.remove();
  }
}
const it = ee;
function ee(n, t) {
  const e = ne();
  return (ee = function(i, r) {
    return e[i -= 370];
  })(n, t);
}
(function() {
  const n = ee, t = ne();
  for (; ; )
    try {
      if (-parseInt(n(383)) / 1 * (parseInt(n(386)) / 2) + -parseInt(n(388)) / 3 + parseInt(n(371)) / 4 + parseInt(n(387)) / 5 + parseInt(n(384)) / 6 + -parseInt(n(372)) / 7 * (parseInt(n(382)) / 8) + parseInt(n(380)) / 9 === 797336)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var ln = Object[it(376)], hn = Object.getOwnPropertyDescriptor;
class ze extends Vt {
  constructor(t, e = 0, i = 0, r = 1, s = 1) {
    super(t, e, i, r, s), this._drawData = { a: { x: 0, y: 0 }, z: { x: 0, y: 0 } };
  }
  _beforDraw() {
    const t = it;
    let e = this[t(378)], i = this.outLinks;
    const r = this;
    let s = 0, l = 0;
    e.length > 0 && (s = Be(r[t(378)][0].getBeginPoint(), r)), i.length > 0 && (l = Be(r[t(373)][0][t(375)](), r));
    let o = Math.min(this.width / 2, this.height / 2);
    this._drawData.a = { x: Math.cos(s) / 1.618 * o, y: Math.sin(s) / 1.618 * o }, this._drawData.z = { x: Math.cos(l) / 1.618 * o, y: Math[t(381)](l) / 1.618 * o };
  }
  draw(t) {
    const e = it;
    t.strokeStyle = "blue", t.lineCap = e(385), t.lineWidth = 20, this._beforDraw();
    let i = this._drawData.a, r = this._drawData.z;
    t[e(389)](), t[e(370)](i.x, i.y), t.lineTo(i.x / 1.618, i.y / 1.618), t[e(379)](0, 0, r.x / 1.618, r.y / 1.618), t.lineTo(r.x, r.y), t.stroke();
  }
}
function ne() {
  const n = ["defineProperty", "com.jtopo.extensions", "inLinks", "quadraticCurveTo", "12846942hghOyT", "sin", "198616vSKZqf", "20948ZotMdE", "6430074EcyHzM", "square", "128ctGCHH", "7451450PzlQPV", "2304723lbfEBr", "beginPath", "moveTo", "1427232MhJqbf", "406lCOcyc", "outLinks", "JointLNode", "getEndPoint"];
  return (ne = function() {
    return n;
  })();
}
function Be(n, t) {
  let e = n.x - t.x, i = n.y - t.y;
  return Math.atan2(i, e);
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? hn(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && ln(t, e, s);
})([R(it(374))], ze.prototype, "className", 2), N.regClass(it(377), "JointLNode", ze);
const U = st;
function ie() {
  const n = ["stroke", "121NqwkWo", "1238091rcOBNp", "width", "lineWidth", "1020957TaHhlo", "padding", "4CHKWFP", "1398321vYQfGs", "com.jtopo.extensions", "destroy", "setAttributes", "setupAE", "update", "302406XCSoGG", "BlinkingArrow", "animations", "regClass", "10wZsqrL", "alphas", "1685368qLqTqH", "15170LrnevM", "560788nrUWyT", "round", "18IiuHsz", "aeOptions", "shadowOffsetX", "shadowOffsetY"];
  return (ie = function() {
    return n;
  })();
}
(function() {
  const n = st, t = ie();
  for (; ; )
    try {
      if (parseInt(n(267)) / 1 + -parseInt(n(266)) / 2 * (parseInt(n(261)) / 3) + -parseInt(n(253)) / 4 + -parseInt(n(249)) / 5 * (parseInt(n(273)) / 6) + parseInt(n(264)) / 7 + parseInt(n(251)) / 8 * (parseInt(n(255)) / 9) + parseInt(n(252)) / 10 * (parseInt(n(260)) / 11) === 915808)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var cn = Object.defineProperty, un = Object.getOwnPropertyDescriptor;
class He extends Zt {
  constructor(t, e = 0, i = 0, r = 1, s = 1) {
    const l = st;
    super(t, e, i, r, s), this[l(256)] = { arrowNumbers: 5, blinkFrequency: 1e3 }, this.aeStatus = {};
  }
  ae(t) {
    Object.assign(this[st(256)], t);
  }
  [U(271)]() {
    const t = U;
    let e = [];
    this.aeStatus[t(250)] = e;
    let i = this.aeOptions.arrowNumbers;
    for (let l = 0; l < i; l++)
      e.push(0.5);
    let r = this, s = new P();
    s.name = t(274), s[t(270)]({ from: 0, to: i, duration: r[t(256)].blinkFrequency, times: 1 / 0, update: (l) => {
      const o = t;
      let h = Math[o(254)](l);
      h > i || (h > 0 && (e[h - 1] = 0.5), h == 0 && (e[e.length - 1] = 0.5), e[h] = 1, r[o(272)]());
    } }), this[t(247)].push(s);
  }
  draw(t) {
    const e = U;
    let i = this[e(262)], r = this.height, s = this.getComputedStyle();
    s.applyTo(t);
    let l = s.borderWidth || 0, o = s[e(265)] || 0, h = 0.5 * -i + l + o, a = (i - (2 * o + 2 * l)) / this[e(256)].arrowNumbers, c = this.aeStatus.alphas;
    for (let u = 0; u < this[e(256)].arrowNumbers; u++)
      t.save(), t.beginPath(), c[u] == 1 && (t[e(258)] = 2, t[e(257)] = 2, t.shadowColor = s.strokeStyle || "gray", t[e(263)] = 0.5 * s.lineWidth + 0.5 * c[u] * s.lineWidth, t.shadowBlur = 13 * c[u]), t.globalAlpha = c[u], t.moveTo(h + a * u, 0.5 * -r), t.lineTo(h + a * u + 0.5 * a, 0), t.lineTo(h + a * u, 0.5 * r), t[e(259)](), t.restore();
    this._paintText(t);
  }
  destroy() {
    super[U(269)](), this.aeStatus = null;
  }
}
function st(n, t) {
  const e = ie();
  return (st = function(i, r) {
    return e[i -= 247];
  })(n, t);
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? un(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && cn(t, e, s);
})([R("BlinkingArrowNode")], He.prototype, "className", 2), N[U(248)](U(268), "BlinkingArrowNode", He);
const E = re;
function se() {
  const n = ["push", "circleNumber", "_onAEChanged", "21306JjKWeC", "Rippling", "length", "height", "321inSFru", "radiusMax", "getOwnPropertyDescriptor", "792KTBBpw", "RipplingNode", "3082KkGNVT", "radiusDx", "forEach", "strokeStyle", "440QzhiQE", "globalAlpha", "13156obnOVt", "1985ObWMXb", "defineProperty", "259larNEt", "animations", "_height", "6330oxAnQE", "assign", "708NhwTBr", "94009oNTJJM", "lineWidth", "className", "4851Eiolxm", "1756HqiZqp", "radius"];
  return (se = function() {
    return n;
  })();
}
(function() {
  const n = re, t = se();
  for (; ; )
    try {
      if (-parseInt(n(135)) / 1 + -parseInt(n(153)) / 2 * (-parseInt(n(148)) / 3) + -parseInt(n(139)) / 4 * (parseInt(n(127)) / 5) + parseInt(n(144)) / 6 * (parseInt(n(129)) / 7) + parseInt(n(151)) / 8 * (parseInt(n(138)) / 9) + parseInt(n(132)) / 10 * (-parseInt(n(157)) / 11) + parseInt(n(134)) / 12 * (parseInt(n(126)) / 13) === 115731)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var pn = Object[E(128)], dn = Object[E(150)];
function re(n, t) {
  const e = se();
  return (re = function(i, r) {
    return e[i -= 125];
  })(n, t);
}
class Re extends Zt {
  constructor(t, e = 0, i = 0, r = 50, s = 50) {
    super(t, e, i, r, s), this.aeOptions = { circleNumber: 2 }, this.aeStatus = { circles: [], radiusMax: 1, radiusDx: 0, circleNumber: 0, lineWidthMax: 6 };
  }
  ae(t) {
    const e = E;
    Object[e(133)](this.aeOptions, t), this[e(143)]();
  }
  [E(143)]() {
    const t = E;
    let e = this.aeStatus, i = this.aeOptions, r = 0.5 * Math.min(this.width, this.height), s = i.circleNumber || 5;
    if (e.circleNumber !== s) {
      e.circleNumber = s;
      const l = [];
      for (let o = 0; o < e[t(142)]; o++)
        l.push({ radius: 0, lineWidth: 0, globalAlpha: 0 });
      e.circles = l;
    }
    e[t(149)] !== r && this.animations && this.animations[t(155)]((l) => {
      const o = t;
      l.to = [e[o(149)]];
    }), e.radiusMax = r, e.radiusDx = e.radiusMax / s;
  }
  _afterStyleComputed() {
    const t = E;
    super._afterStyleComputed(), this.aeStatus.lineWidthMax = this.getComputedStyle()[t(136)] || 6;
  }
  setupAE() {
    const t = E;
    let e = this.aeStatus;
    this[t(143)]();
    let i = new P({ object: this, name: t(145), from: [1], to: [e.radiusMax], update: (r) => {
      const s = t;
      let l = e.circles, o = Math.max(r[0], 0);
      for (let h = 0; h < l.length; h++) {
        let a = l[h], c = o + h * e[s(154)];
        c > e.radiusMax && (c %= e.radiusMax);
        let u = c / e.radiusMax;
        a[s(140)] = c, a.lineWidth = u * e.lineWidthMax, a.globalAlpha = 1 - Math.min(1, c / e[s(149)]);
      }
    }, times: 1 / 0, duration: 2e3 });
    this[t(130)][t(141)](i);
  }
  set width(t) {
    super.width = t, this._onAEChanged();
  }
  get width() {
    return this._width;
  }
  set height(t) {
    super[E(147)] = t, this._onAEChanged();
  }
  get height() {
    return this[E(131)];
  }
  draw(t) {
    const e = E;
    let i = this.aeStatus.circles, r = this.getComputedStyle();
    t[e(156)] = r[e(156)];
    for (let s = 0; s < i.length; s++) {
      let l = i[s];
      t.beginPath(), t.lineWidth = l.lineWidth, t.globalAlpha = l[e(125)], t.ellipse(0, 0, l[e(140)], l.radius, 0, 0, 2 * Math.PI), t.stroke();
    }
  }
}
((n, t, e, i) => {
  const r = E;
  for (var s, l = i > 1 ? void 0 : i ? dn(t, e) : t, o = n[r(146)] - 1; o >= 0; o--)
    (s = n[o]) && (l = (i ? s(t, e, l) : s(l)) || l);
  i && l && pn(t, e, l);
})([R(E(152))], Re.prototype, E(137), 2), N.regClass("com.jtopo.extensions", "RipplingNode", Re);
const q = C;
(function() {
  const n = C, t = oe();
  for (; ; )
    try {
      if (parseInt(n(449)) / 1 * (parseInt(n(440)) / 2) + parseInt(n(438)) / 3 + parseInt(n(423)) / 4 + parseInt(n(445)) / 5 * (-parseInt(n(426)) / 6) + parseInt(n(447)) / 7 + parseInt(n(419)) / 8 + -parseInt(n(443)) / 9 * (parseInt(n(429)) / 10) === 594421)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var fn = Object.defineProperty, gn = Object.getOwnPropertyDescriptor;
function oe() {
  const n = ["className", "_width", "aeStatus", "rightPoints", "height", "stroke", "1752021msmFjr", "aeOptions", "10ubWVon", "destroy", "beginPath", "11351277EZhcng", "#43b1f5", "5IwSHvZ", "setStyle", "2768997kpFSuC", "waveHeight", "129542SjMcta", "_updateWaveline", "width", "_getShapeSize", "capacity", "color", "5373704MGzYWl", "_afterStyleComputed", "borderRadius", "_onAEChanged", "2257944KCmyhX", "strokeStyle", "fill", "6046878lnaVZt", "_paintText", "lineWidth", "10bZmAGw", "restore", "forEach"];
  return (oe = function() {
    return n;
  })();
}
function C(n, t) {
  const e = oe();
  return (C = function(i, r) {
    return e[i -= 415];
  })(n, t);
}
class We extends Zt {
  constructor(t, e = 0, i = 0, r = 1, s = 1) {
    const l = C;
    super(t, e, i, r, s), this.aeOptions = { capacity: 0.5, waveHeight: 10 }, this[l(434)] = { leftPoints: [], rightPoints: [], capacity: 0, width: -1, height: -1, waveHeight: 0 }, this[l(446)]("fillStyle", "#43b1f5");
  }
  ae(t) {
    Object.assign(this[C(439)], t), this._onAEChanged();
  }
  _afterStyleComputed() {
    const t = C;
    super[t(420)](), this[t(422)]();
  }
  _updateWaveline() {
    const t = C, e = this.aeStatus;
    let i = e.leftPoints, r = e[t(435)], s = e.height * (1 - e.capacity) - 0.5 * e.height;
    i[0].y = s, i[1].y = s + e.waveHeight, i[2].y = s - e[t(448)], i[3].y = s, r[0].y = i[0].y, r[1].y = i[1].y, r[2].y = i[2].y, r[3].y = i[3].y;
  }
  _onAEChanged() {
    const t = C, e = this[t(434)], i = this._getShapeSize(), r = this.aeOptions[t(448)] == null ? 10 : this[t(439)].waveHeight, s = this.aeOptions[t(417)] == null ? 0.5 : this.aeOptions.capacity;
    if (e.width !== i.width || e.height !== i.height) {
      this._updateShapeSize();
      let l = this._getShapeSize().width, o = -l / 2, h = [{ x: o, y: 0 }, { x: o + l / 4, y: 0 }, { x: o + l - l / 4, y: 0 }, { x: o + l, y: 0 }], a = h.map((c) => ({ x: c.x + l, y: c.y }));
      e.leftPoints = h, e.rightPoints = a;
    }
    e.waveHeight = r, e[t(415)] = i[t(415)], e.height = i[t(436)], e.capacity = s, this[t(450)]();
  }
  setupAE() {
    const t = this.aeStatus;
    let e = new P({ name: "WaterLike", from: 0, to: 1, duration: 1500, times: 1 / 0, update: (i) => {
      const r = C;
      let s = t.width, l = 0.01 * s, o = 0.5 * s, h = t.leftPoints, a = t[r(435)];
      a[0].x >= o && (a[0].x = -o - s, a[1].x = a[0].x + s / 4, a[3].x = a[0].x + s, a[2].x = a[3].x - s / 4), h[0].x >= o && (h[0].x = -o - s, h[1].x = h[0].x + s / 4, h[3].x = h[0].x + s, h[2].x = h[3].x - s / 4), h.forEach((c, u) => {
        c.x += l;
      }), a[r(431)]((c, u) => {
        c.x += l;
      });
    } });
    this._onAEChanged(), this.animations.push(e);
  }
  draw(t) {
    const e = C;
    let i = this[e(416)](), r = i.width, s = i.height, l = this.getComputedStyle();
    l.applyTo(t);
    let o = l[e(428)], h = 0.5 * -r, a = 0.5 * -s;
    t.beginPath(), l[e(421)] != null ? t.roundRect(h, a, r, s, l.borderRadius) : t.rect(h, a, r, s), t.closePath(), o != 0 && t.stroke();
    {
      t.save();
      let c = 0.5 * o;
      t[e(442)](), l.borderRadius != null ? t.roundRect(h + c, a + c, r - o, s - o, l.borderRadius) : t.rect(h + c, a + c, r - o, s - o), t.closePath(), o != 0 && (t.lineWidth = 2 * o, t[e(424)] = "rgba(0,0,0,0)", t[e(437)]()), t.clip();
      let u = this[e(434)].leftPoints, f = this.aeStatus[e(435)];
      if (t[e(442)](), u[0].x >= f[0].x) {
        let p = u;
        u = f, f = p;
      }
      t.moveTo(u[0].x, u[0].y), t.bezierCurveTo(u[1].x, u[1].y, u[2].x, u[2].y, u[3].x, u[3].y), t.bezierCurveTo(f[1].x, f[1].y, f[2].x, f[2].y, f[3].x, f[3].y), t.lineTo(f[3].x, -a), t.lineTo(u[0].x, -a), t.lineTo(u[0].x, u[0].y), t.closePath(), t.fillStyle = l.fillStyle || e(444), t[e(425)](), t[e(430)]();
    }
    l[e(418)] && (t.fillStyle = l[e(418)]), this[e(427)](t);
  }
  set [q(415)](t) {
    super.width = t, this._onAEChanged();
  }
  get [q(415)]() {
    return this[q(433)];
  }
  set height(t) {
    const e = q;
    super.height = t, this[e(422)]();
  }
  get height() {
    return this._height;
  }
  destroy() {
    super[q(441)](), this.aeStatus = null;
  }
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? gn(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && fn(t, e, s);
})([R("WaterLikeNode")], We.prototype, q(432), 2), N.regClass("com.jtopo.extensions", "WaterLikeNode", We);
const F = rt;
function rt(n, t) {
  const e = ae();
  return (rt = function(i, r) {
    return e[i -= 249];
  })(n, t);
}
function ae() {
  const n = ["getAttribute", "77990vntGrL", "foreground", "max", "stroke-width", "domToJson", "parse", "473214CsqnQG", "domChildrenToJson", "getElementsByTagName", "documentElement", "306415cXwqaL", "path", "4759218pBrXUE", "arcsize", "tagName", "497TFCfyx", "length", "attributes", "699046ugDSwZ", "4urzJqH", "18840iudbkd", "3129078cGgBsn", "stroke-dasharray"];
  return (ae = function() {
    return n;
  })();
}
(function() {
  const n = rt, t = ae();
  for (; ; )
    try {
      if (parseInt(n(260)) / 1 + -parseInt(n(266)) / 2 + parseInt(n(272)) / 3 + parseInt(n(261)) / 4 * (-parseInt(n(252)) / 5) + -parseInt(n(263)) / 6 + parseInt(n(257)) / 7 * (-parseInt(n(262)) / 8) + parseInt(n(254)) / 9 === 596590)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class mn {
  constructor(t) {
    this[rt(251)] = this.textToElement(t);
  }
  textToElement(t) {
    return new DOMParser().parseFromString(t, "text/xml").documentElement;
  }
  toJson() {
    const t = rt, e = this[t(251)];
    let i = e.children, r = e.getAttribute("name");
    if (r == null)
      throw new Error("category is null");
    let s = [], l = { package: r, shapes: s };
    for (let o = 0; o < i.length; o++) {
      let h = i[o], a = h.getAttribute("name"), c = parseFloat(h.getAttribute("w")), u = parseFloat(h[t(265)]("h")), f = [], p = h.getElementsByTagName("connections")[0];
      p != null && (f = this.domChildrenToJson(p, 1, 1));
      let d = this[t(271)](h[t(250)]("background")[0], c, u), g = this.parse(h.getElementsByTagName(t(267))[0], c, u), y = { className: a, width: c, height: u };
      f.length > 0 && (y.connections = f), d.length > 0 && (y.background = d), g.length > 0 && (y.foreground = g), s.push(y);
    }
    return l;
  }
  [F(249)](t, e, i) {
    const r = F;
    let s = t.children, l = [];
    for (let o = 0; o < s[r(258)]; o++) {
      let h = this.domToJson(s[o], e, i);
      l.push(h);
    }
    return l;
  }
  [F(270)](t, e, i) {
    const r = F;
    let s = { T: t.tagName }, l = t[r(259)];
    for (let o = 0; o < l[r(258)]; o++) {
      let h = l[o], a = h.name, c = h.value;
      (a == "x" || a == "y" || a == "arcsize" || a == "w" || a == "h" || a == "x1" || a == "y1" || a == "x2" || a == "y2" || a == "x3" || a == "y3" || a == "cx" || a == "cy" || a == "limit" || a == "fontsize" || a == "x-axis-rotation" || a == "large-arc-flag" || a == "sweep-flag" || a == "r" || a == "rx" || a == "ry" || a == r(269) || a == "stroke-dasharray" || a == "stroke-dashoffset" || a == "stroke-linecap" || a == "stroke-linejoin" || a == "stroke-miterlimit" || a == "stroke-opacity" || a == r(269) || a == r(264)) && (c = parseFloat(c)), s[a] = c;
    }
    return this.unitCmd(s, e, i), s;
  }
  parse(t, e, i) {
    const r = F;
    let s = [];
    if (t == null)
      return [];
    let l = t.children;
    for (let o = 0; o < l.length; o++) {
      let h = l[o];
      if (h[r(256)] == "path") {
        let a = this.domChildrenToJson(h, e, i);
        s.push({ T: r(253), m: a });
      } else
        s.push(this[r(270)](h, e, i));
    }
    return s;
  }
  unitCmd(t, e, i) {
    const r = F;
    t.x != null && (t.x = t.x / e), t.y != null && (t.y = t.y / i), t.x1 != null && (t.x1 = t.x1 / e), t.y1 != null && (t.y1 = t.y1 / i), t.x2 != null && (t.x2 = t.x2 / e), t.y2 != null && (t.y2 = t.y2 / i), t.x3 != null && (t.x3 = t.x3 / e), t.y3 != null && (t.y3 = t.y3 / i), t.rx != null && (t.rx = t.rx / e), t.ry != null && (t.ry = t.ry / i), t.w != null && (t.w = t.w / e), t.h != null && (t.h = t.h / i), t.r != null && (t.r = t.r / Math[r(268)](e, i)), t.arcsize != null && (t[r(255)] = t.arcsize / Math.max(e, i));
  }
}
const De = kt;
function le() {
  const n = ["ctx.miterLimit = '", "3320229kuRDWm", "max", "ellipse", "4718DCLFyf", "fillcolor", "miterlimit", "163810wtjLIv", "x-axis-rotation", "fontcolor", "20AvAQOo", "stroke", "width", 'let path2D = new Path2D("', "drawPathArray", "curve", 'ctx.font = "normal " + ', "ctx.fill(currPath);", "ctx.fill();", "681944nrZpAi", "pathStr", "close", "size", "ctx.stroke();", "lineWidth", "ctx.restore();", "rect", "ctx.arc(", "valign", "circle", "str", "join", ", 0, 2 * Math.PI);", "linejoin", "7086CTnjRi", "large-arc-flag", '");', "limit", "fill", "sweep-flag", "1967605IVVZsr", "7639011ukMOio", "arcsize", "normal ", "length", "isClosed", "10ocugVR", "strokecolor", "restore", "beginPath", "ctx.fillStyle = '", "getPathInfo", "3752752SJVTgG", "push", "fontsize"];
  return (le = function() {
    return n;
  })();
}
(function() {
  const n = kt, t = le();
  for (; ; )
    try {
      if (-parseInt(n(454)) / 1 * (parseInt(n(493)) / 2) + parseInt(n(503)) / 3 + -parseInt(n(499)) / 4 + parseInt(n(487)) / 5 + -parseInt(n(481)) / 6 * (parseInt(n(451)) / 7) + -parseInt(n(466)) / 8 + -parseInt(n(488)) / 9 * (-parseInt(n(457)) / 10) === 559347)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class yn {
  constructor() {
  }
  getPathInfo(t, e, i) {
    const r = kt;
    let s = "", l = !1;
    for (let o = 0; o < t[r(491)]; o++) {
      let h = t[o], a = h.T;
      a == "move" ? s += "M" + h.x * e + " " + h.y * i : a == "line" ? s += "L" + h.x * e + " " + h.y * i : a == "arc" ? s += "A" + h.rx * e + " " + h.ry * i + " " + h["x-axis-rotation"] + " " + h[r(482)] + " " + h[r(486)] + " " + h.x * e + " " + h.y * i : a == "curve" ? s += "C" + h.x1 * e + " " + h.y1 * i + " " + h.x2 * e + " " + h.y2 * i + " " + h.x3 * e + " " + h.y3 * i : a == r(468) && (s += "Z", l = !0);
    }
    return { isClosed: l, pathStr: s };
  }
  [De(461)](t, e, i = 1, r = 1, s = 1) {
    const l = De;
    let o, h = null, a = null, c = i, u = r;
    for (let f = 0; f < e[l(491)]; f++) {
      let p = e[f], d = p.T;
      if (d == "path") {
        let g = this.getPathInfo(p.m, c, u);
        o = new Path2D(g[l(467)]), g.isClosed && o.closePath();
      } else if (d == "move")
        h = p.x, a = p.y, t.moveTo(p.x * c, p.y * u);
      else if (d == "close")
        t.closePath();
      else if (d == "line")
        h = p.x, a = p.y, t.lineTo(p.x * c, p.y * u);
      else if (d == l(473))
        t[l(496)](), p.x == null || t.rect(p.x * c, p.y * u, p.w * c, p.h * u);
      else if (d == "roundrect")
        t[l(496)](), p.x == null || t.roundRect(p.x * c, p.y * u, p.w * c, p.h * u, p[l(489)] * Math.max(c, u));
      else if (d == l(476))
        t.beginPath(), t.arc(p.cx * c, p.cy * u, p.r * Math.max(c, u), 0, 2 * Math.PI);
      else if (d == l(450))
        t.beginPath(), t.ellipse((p.x + p.w / 2) * c, (p.y + p.h / 2) * u, p.w / 2 * c, p.h / 2 * u, 0, 0, 2 * Math.PI);
      else if (d == "arc") {
        let g = "M" + h * c + " " + a * u + " A" + p.rx * c + " " + p.ry * u + " " + p[l(455)] + " " + p["large-arc-flag"] + " " + p["sweep-flag"] + " " + p.x * c + " " + p.y * u, y = new Path2D(g);
        s > 0 && t.stroke(y), h = p.x, a = p.y;
      } else
        d == l(462) ? t.bezierCurveTo(p.x1 * c, p.y1 * u, p.x2 * c, p.y2 * u, p.x3 * c, p.y3 * u) : d == "text" ? (t.textAlign = p.align, t.textBaseline = p.valign, t.fillText(p.str, p.x * c, p.y * u)) : d == l(501) ? t.font = l(490) + p[l(469)] + "px sans-serif" : d == "fontcolor" ? t.fillStyle = p.color : d == l(453) ? t.miterLimit = p.limit : d == "linecap" ? t.lineCap = p.cap : d == l(480) ? t.linejoin = p[l(478)] : d == l(458) ? o != null ? (s > 0 && t.stroke(o), o = null) : s > 0 && t.stroke() : d == l(485) ? o != null ? (t.fill(o), o = null) : t.fill() : d == "strokewidth" ? t[l(471)] = p.width : d == "fillstroke" ? o != null ? (t.fill(o), s > 0 && t.stroke(o), o = null) : (t.fill(), s > 0 && t.stroke()) : d == "strokecolor" ? t.strokeStyle = p.color : d == l(452) ? t.fillStyle = p.color : d == "save" ? t.save() : d == l(495) && t.restore();
    }
  }
}
function kt(n, t) {
  const e = le();
  return (kt = function(i, r) {
    return e[i -= 449];
  })(n, t);
}
function Mt(n, t) {
  var e = he();
  return (Mt = function(i, r) {
    return e[i -= 388];
  })(n, t);
}
var xn = Mt;
(function() {
  for (var n = Mt, t = he(); ; )
    try {
      if (parseInt(n(391)) / 1 + -parseInt(n(406)) / 2 * (parseInt(n(405)) / 3) + parseInt(n(402)) / 4 + parseInt(n(388)) / 5 * (parseInt(n(399)) / 6) + parseInt(n(392)) / 7 * (-parseInt(n(397)) / 8) + -parseInt(n(400)) / 9 + -parseInt(n(395)) / 10 * (parseInt(n(390)) / 11) === 684293)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var wn = Object.defineProperty, bn = Object.getOwnPropertyDescriptor;
const vn = new yn();
class qt extends sn {
  constructor() {
    super(), this.aspect = "variable";
  }
  draw(t, e) {
    var i = Mt;
    if (this[i(404)] == null)
      return;
    let r = e[i(393)]()[i(396)], s = e._drawContentDesc.shapeSize, l = 0.5 * -s[i(389)], o = 0.5 * -s.height;
    t[i(394)](), t[i(401)](l, o), vn.drawPathArray(t, this._pathArray, s.width, s[i(403)], r), t.restore();
  }
}
function he() {
  var n = ["lineWidth", "536iuqIkG", "com.jtopo.extensions", "7206fOkqGG", "10072476yAVbep", "translate", "2240816zOMHjb", "height", "_pathArray", "324UNCYFT", "1304SDEIpu", "5465BOzVRX", "width", "485034jjTyEx", "1357868cginPA", "137158MoFiqi", "getComputedStyle", "save", "10HxNctV"];
  return (he = function() {
    return n;
  })();
}
function wt(n, t) {
  const e = ce();
  return (wt = function(i, r) {
    return e[i -= 108];
  })(n, t);
}
function ce() {
  const n = ["concat", "package", "2149020uoGZTx", "forEach", "111390rMugjh", "height", "46346RVsRIw", "1608684uZhhPp", "map", "width", "connections", "643170CRDMyO", "525480jpMCgk", "namespace", "494410rEGGpG"];
  return (ce = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? bn(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && wn(t, e, s);
})([R("XMLShape")], qt.prototype, "className", 2), N.regClass(xn(398), "XMLShape", qt), function() {
  const n = wt, t = ce();
  for (; ; )
    try {
      if (-parseInt(n(120)) / 1 + -parseInt(n(118)) / 2 + parseInt(n(110)) / 3 + -parseInt(n(121)) / 4 + parseInt(n(111)) / 5 + parseInt(n(116)) / 6 + parseInt(n(113)) / 7 === 244074)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
}();
const Dn = { fromXml: function(n) {
  const t = wt;
  let e = new mn(n).toJson();
  return e.shapes[t(122)]((i) => {
    const r = t;
    let s = function(l, o) {
      const h = wt;
      let a = new qt();
      a[h(108)] = o[h(108)], a.height = o[h(119)], a[h(112)] = l + "." + o.className;
      let c = [], u = o.background;
      u && (c = c.concat(u));
      let f = o.foreground;
      return f && (c = c[h(114)](f)), a._pathArray = c, o[h(109)] && (o.connections[h(117)]((p) => {
        p.x = 2 * p.x - 1, p.y = 2 * p.y - 1, p.usage = p.usage || rn.CONNECT_EDIT;
      }), a.setConnections(o[h(109)])), a;
    }(e.package, i);
    return N.regShape(e[r(115)], i.className, s), s;
  });
} }, j = ue;
(function() {
  const n = ue, t = pe();
  for (; ; )
    try {
      if (-parseInt(n(276)) / 1 * (parseInt(n(273)) / 2) + parseInt(n(264)) / 3 * (parseInt(n(271)) / 4) + parseInt(n(261)) / 5 + -parseInt(n(267)) / 6 + parseInt(n(268)) / 7 * (-parseInt(n(274)) / 8) + parseInt(n(278)) / 9 * (parseInt(n(266)) / 10) + parseInt(n(275)) / 11 === 145488)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var In = Object[j(265)], kn = Object.getOwnPropertyDescriptor;
function ue(n, t) {
  const e = pe();
  return (ue = function(i, r) {
    return e[i -= 259];
  })(n, t);
}
class Ft extends Vt {
  constructor(t, e = 0, i = 0, r = 1, s = 1) {
    super(t, e, i, r, s), this.setAttributes({ ratio: 0.5, direction: "right" });
  }
  drawShape(t) {
    const e = j;
    let i = this;
    const r = this.width, s = this.height;
    let l = i[e(262)]("ratio"), o = i[e(262)](e(277)), h = i.getComputedStyle();
    h.fillStyle && (t.fillStyle = h.fillStyle);
    let a = h[e(272)] || 0, c = h.padding || 0, u = 2 * c + 2 * a, f = 0.5 * -r + a + c, p = 0.5 * -s + a + c, d = (r - u) * l, g = (s - u) * l;
    if (o == e(260))
      g = s - u;
    else if (o == "down")
      d = r - u;
    else if (o == "left")
      f = 0.5 * -r + r - a - c - d, g = s - u;
    else {
      if (o != "up")
        throw new Error(e(270) + o);
      p = 0.5 * -s + s - a - c - g, d = r - u;
    }
    t[e(279)](), t.rect(f, p, d, g), t.fill();
  }
}
function pe() {
  const n = ["805bNLSFU", "setAttribute", "Unknow direction:", "10988gqhkNC", "borderWidth", "10KLipqp", "16760VWgxKz", "294712ALFmNw", "43234fhsuie", "direction", "99MmeNDn", "beginPath", "com.jtopo.extensions", "defineProperties", "right", "1229610dGBodr", "getAttribute", "RatioNode", "291AtlIlX", "defineProperty", "78130xrRvdM", "135198ZSVnSM"];
  return (pe = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? kn(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && In(t, e, s);
})([R(j(263))], Ft.prototype, "className", 2), Object[j(259)](Ft.prototype, { ratio: { set(n) {
  this[j(269)]("ratio", n);
}, get() {
  return this.getAttribute("ratio");
} }, direction: { set(n) {
  const t = j;
  this.setAttribute(t(277), n);
}, get() {
  return this[j(262)]("direction");
} } }), N.regClass(j(280), j(263), Ft);
var Ut = G;
function G(n, t) {
  var e = de();
  return (G = function(i, r) {
    return e[i -= 131];
  })(n, t);
}
function de() {
  var n = ["transparent_index", "7PtNjOl", "1756390KUcwLD", "arrayBuffer", "loopCount", "onLoad", "catch", "170kaaIbD", "charCodeAt", "Unknown gif block: 0x", "onmessage", "url", "play", "method", "basePath", "5467HjZpbZ", "2xGuvJu", "2067954gNbgnV", "onError", "Warning, gif stream shorter than expected.", "call", "847256eDYdkq", "toString", "log", "173709HBdDhi", "match", "6432LGMMIC", "frameInfo", "fill", "height", "Invalid graphics extension block.", "4YajSza", "length", "Frame index out of range.", "1188891xGVkuE", 'function o(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,a=t[e++]|t[e++]<<8,n=t[e++],i=n>>7,l=1<<1+(7&n);t[e++],t[e++];var o=null,s=null;i&&(o=e,s=l,e+=3*l);var h=!0,f=[],d=0,c=null,u=0,g=null;for(this.width=r,this.height=a;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,g=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var w=t[e++];d=t[e++]|t[e++]<<8,c=t[e++],1&w||(c=null),u=w>>2&7,e++;break;case 1:case 254:for(;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var p=t[e++]|t[e++]<<8,m=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,k=t[e++],y=k>>6&1,x=1<<1+(7&k),A=o,E=s,I=!1;k>>7&&(I=!0,A=e,E=x,e+=3*x);var _=e;for(e++;;){var F;if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}f.push({x:p,y:m,width:v,height:b,has_local_palette:I,palette_offset:A,palette_size:E,data_offset:_,data_length:e-_,transparent_index:c,interlaced:!!y,delay:d,disposal:u,pixelsArray:new Uint8Array(v*b)});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return g},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameRGBA=function(e,a){var n=this.frameInfo(e),i=n.width*n.height,l=n.pixelsArray;l.fill(0),function(t,e,r,a){for(var n=t[e++],i=1<<n,l=i+1,o=l+1,s=n+1,h=(1<<s)-1,f=0,d=0,c=0,u=t[e++],g=new Int32Array(4096),w=null;;){for(;f<16&&0!==u;)d|=t[e++]<<f,f+=8,1===u?u=t[e++]:--u;if(f<s)break;var p=d&h;if(d>>=s,f-=s,p!==i){if(p===l)break;for(var m=p<o?p:w,v=0,b=m;b>i;)b=g[b]>>8,++v;var k=b;if(c+v+(m!==p?1:0)>a)return void console.log("Warning, gif stream longer than expected.");r[c++]=k;var y=c+=v;for(m!==p&&(r[c++]=k),b=m;v--;)b=g[b],r[--y]=255&b,b>>=8;null!==w&&o<4096&&(g[o++]=w<<8|k,o>=h+1&&s<12&&(++s,h=h<<1|1)),w=p}else o=l+1,h=(1<<(s=n+1))-1,w=null}c!==a&&console.log("Warning, gif stream shorter than expected.")}(t,n.data_offset,l,i);var o=n.palette_offset,s=n.transparent_index;null===s&&(s=256);var h=n.width,f=r-h,d=h,c=4*(n.y*r+n.x),u=4*((n.y+n.height)*r+n.x),g=c,w=4*f;!0===n.interlaced&&(w+=4*r*7);for(var p=8,m=0,v=l.length;m<v;++m){var b=l[m];if(0===d&&(d=h,(g+=w)>=u&&(w=4*f+4*r*(p-1),g=c+(h+f)*(p<<1),p>>=1)),b===s)g+=4;else{var k=t[o+3*b],y=t[o+3*b+1],x=t[o+3*b+2];a[g++]=k,a[g++]=y,a[g++]=x,a[g++]=255}--d}}}const l=self,e=new Map,i={load:function(t){const r=t.basePath,i=t.url;if(i.startsWith("data:image/gif")){const t=i.split(",")[1],r=atob(t),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);const l=n.buffer;let o=new a(i,l);e.set(i,o)}else fetch(new URL(t.url,r).href).then(t=>{if(!t.ok)throw new Error("HTTP status:"+t.status);return t.arrayBuffer()}).then(t=>{let r=new a(i,t);e.set(i,r)}).catch(t=>{n.call("onError",{url:i})})},stop:function(t){let r=e.get(t.url);null!=r&&r.stop()},play:function(t){let r=e.get(t.url);null!=r&&r.play()}},n={call:function(t,e){l.postMessage({method:t,args:e,time:Date.now()})}};l.onmessage=function(t){let e=t.data.method,r=t.data.args;i[e].call(i,r)};class a{constructor(t,e){this.totalFrames=0,this.framenum=0,this.stoped=!0,this.url=t;var r=new o(new Uint8Array(e));this.imageData=new Uint8ClampedArray(r.width*r.height*4),this.totalFrames=r.numFrames(),this.gr=r,n.call("onLoad",{url:t,width:r.width,height:r.height}),this.loopRender()}stop(){this.stoped=!0}play(){this.stoped=!1}loopRender(){const t=this,e=this.gr;var r=this.framenum%this.totalFrames,a=e.frameInfo(r);this.stoped||(0!==r&&2!==a.disposal||this.imageData.fill(0),e.decodeAndBlitFrameRGBA(r,this.imageData),n.call("draw",{url:this.url,width:e.width,height:e.height,pixes:this.imageData})),setTimeout(()=>{t.loopRender(),t.framenum++},10*a.delay)}}', "totalFrames", "721989MnTkTt"];
  return (de = function() {
    return n;
  })();
}
(function() {
  for (var n = G, t = de(); ; )
    try {
      if (-parseInt(n(162)) / 1 * (-parseInt(n(141)) / 2) + -parseInt(n(159)) / 3 + parseInt(n(156)) / 4 * (-parseInt(n(165)) / 5) + parseInt(n(142)) / 6 + parseInt(n(164)) / 7 * (parseInt(n(146)) / 8) + parseInt(n(149)) / 9 * (-parseInt(n(132)) / 10) + parseInt(n(140)) / 11 * (parseInt(n(151)) / 12) === 363255)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), (function() {
  var n = G;
  const t = self, e = /* @__PURE__ */ new Map(), i = { load: function(o) {
    var h = G;
    const a = o[h(139)], c = o.url;
    if (c.startsWith("data:image/gif")) {
      const u = c.split(",")[1], f = atob(u), p = new Uint8Array(f.length);
      for (let y = 0; y < f.length; y++)
        p[y] = f[h(133)](y);
      const d = p.buffer;
      let g = new s(c, d);
      e.set(c, g);
    } else
      fetch(new URL(o[h(136)], a).href).then((u) => {
        var f = h;
        if (!u.ok)
          throw new Error("HTTP status:" + u.status);
        return u[f(166)]();
      }).then((u) => {
        let f = new s(c, u);
        e.set(c, f);
      })[h(131)]((u) => {
        var f = h;
        r[f(145)](f(143), { url: c });
      });
  }, stop: function(o) {
    let h = e.get(o.url);
    h != null && h.stop();
  }, play: function(o) {
    var h = G;
    let a = e.get(o[h(136)]);
    a != null && a[h(137)]();
  } }, r = { call: function(o, h) {
    t.postMessage({ method: o, args: h, time: Date.now() });
  } };
  t[n(135)] = function(o) {
    var h = n;
    let a = o.data[h(138)], c = o.data.args;
    i[a][h(145)](i, c);
  };
  class s {
    constructor(h, a) {
      var c = n;
      this.totalFrames = 0, this.framenum = 0, this.stoped = !0, this[c(136)] = h;
      var u = new l(new Uint8Array(a));
      this.imageData = new Uint8ClampedArray(u.width * u[c(154)] * 4), this[c(161)] = u.numFrames(), this.gr = u, r[c(145)](c(168), { url: h, width: u.width, height: u.height }), this.loopRender();
    }
    stop() {
      this.stoped = !0;
    }
    play() {
      this.stoped = !1;
    }
    loopRender() {
      var h = n;
      const a = this, c = this.gr;
      var u = this.framenum % this.totalFrames, f = c.frameInfo(u);
      !this.stoped && ((u === 0 || f.disposal === 2) && this.imageData[h(153)](0), c.decodeAndBlitFrameRGBA(u, this.imageData), r.call("draw", { url: this.url, width: c.width, height: c[h(154)], pixes: this.imageData })), setTimeout(() => {
        a.loopRender(), a.framenum++;
      }, 10 * f.delay);
    }
  }
  function l(o) {
    var h = n, a = 0;
    if (o[a++] !== 71 || o[a++] !== 73 || o[a++] !== 70 || o[a++] !== 56 || (o[a++] + 1 & 253) != 56 || o[a++] !== 97)
      throw new Error("Invalid GIF 87a/89a header.");
    var c = o[a++] | o[a++] << 8, u = o[a++] | o[a++] << 8, f = o[a++], p = f >> 7, d = 1 << (7 & f) + 1;
    o[a++], o[a++];
    var g = null, y = null;
    p && (g = a, y = d, a += 3 * d);
    var k = !0, I = [], W = 0, Z = null, Ie = 0, ke = null;
    for (this.width = c, this.height = u; k && a < o[h(157)]; )
      switch (o[a++]) {
        case 33:
          switch (o[a++]) {
            case 255:
              if (o[a] !== 11 || o[a + 1] == 78 && o[a + 2] == 69 && o[a + 3] == 84 && o[a + 4] == 83 && o[a + 5] == 67 && o[a + 6] == 65 && o[a + 7] == 80 && o[a + 8] == 69 && o[a + 9] == 50 && o[a + 10] == 46 && o[a + 11] == 48 && o[a + 12] == 3 && o[a + 13] == 1 && o[a + 16] == 0)
                a += 14, ke = o[a++] | o[a++] << 8, a++;
              else
                for (a += 12; ; ) {
                  if (!((L = o[a++]) >= 0))
                    throw Error("Invalid block size");
                  if (L === 0)
                    break;
                  a += L;
                }
              break;
            case 249:
              if (o[a++] !== 4 || o[a + 4] !== 0)
                throw new Error(h(155));
              var Me = o[a++];
              W = o[a++] | o[a++] << 8, Z = o[a++], 1 & Me || (Z = null), Ie = Me >> 2 & 7, a++;
              break;
            case 1:
            case 254:
              for (; ; ) {
                if (!((L = o[a++]) >= 0))
                  throw Error("Invalid block size");
                if (L === 0)
                  break;
                a += L;
              }
              break;
            default:
              throw new Error("Unknown graphic control label: 0x" + o[a - 1].toString(16));
          }
          break;
        case 44:
          var Ge = o[a++] | o[a++] << 8, Ve = o[a++] | o[a++] << 8, Ee = o[a++] | o[a++] << 8, Te = o[a++] | o[a++] << 8, Tt = o[a++], Ze = Tt >> 6 & 1, Se = 1 << (7 & Tt) + 1, Ce = g, Le = y, Ae = !1;
          Tt >> 7 && (Ae = !0, Ce = a, Le = Se, a += 3 * Se);
          var je = a;
          for (a++; ; ) {
            var L;
            if (!((L = o[a++]) >= 0))
              throw Error("Invalid block size");
            if (L === 0)
              break;
            a += L;
          }
          I.push({ x: Ge, y: Ve, width: Ee, height: Te, has_local_palette: Ae, palette_offset: Ce, palette_size: Le, data_offset: je, data_length: a - je, transparent_index: Z, interlaced: !!Ze, delay: W, disposal: Ie, pixelsArray: new Uint8Array(Ee * Te) });
          break;
        case 59:
          k = !1;
          break;
        default:
          throw new Error(h(134) + o[a - 1].toString(16));
      }
    this.numFrames = function() {
      return I.length;
    }, this[h(167)] = function() {
      return ke;
    }, this[h(152)] = function(J) {
      var D = h;
      if (J < 0 || J >= I.length)
        throw new Error(D(158));
      return I[J];
    }, this.decodeAndBlitFrameRGBA = function(J, D) {
      var St = h, M = this.frameInfo(J), Je = M.width * M.height, lt = M.pixelsArray;
      lt[St(153)](0), function(ut, pt, Nt, _e) {
        for (var Pe = n, zt = ut[pt++], Bt = 1 << zt, Ht = Bt + 1, X = Ht + 1, B = zt + 1, Y = (1 << B) - 1, Q = 0, Rt = 0, K = 0, dt = ut[pt++], Wt = new Int32Array(4096), $ = null; ; ) {
          for (; Q < 16 && dt !== 0; )
            Rt |= ut[pt++] << Q, Q += 8, dt === 1 ? dt = ut[pt++] : --dt;
          if (Q < B)
            break;
          var H = Rt & Y;
          if (Rt >>= B, Q -= B, H !== Bt) {
            if (H === Ht)
              break;
            for (var ft = H < X ? H : $, gt = 0, A = ft; A > Bt; )
              A = Wt[A] >> 8, ++gt;
            var Dt = A;
            if (K + gt + (ft !== H ? 1 : 0) > _e)
              return void console.log("Warning, gif stream longer than expected.");
            Nt[K++] = Dt;
            var tn = K += gt;
            for (ft !== H && (Nt[K++] = Dt), A = ft; gt--; )
              A = Wt[A], Nt[--tn] = 255 & A, A >>= 8;
            $ !== null && X < 4096 && (Wt[X++] = $ << 8 | Dt, X >= Y + 1 && B < 12 && (++B, Y = Y << 1 | 1)), $ = H;
          } else
            X = Ht + 1, Y = (1 << (B = zt + 1)) - 1, $ = null;
        }
        K !== _e && console[Pe(148)](Pe(144));
      }(o, M.data_offset, lt, Je);
      var Ct = M.palette_offset, Lt = M[St(163)];
      Lt === null && (Lt = 256);
      var ht = M.width, At = c - ht, jt = ht, Oe = 4 * (M.y * c + M.x), Xe = 4 * ((M.y + M.height) * c + M.x), z = Oe, Ot = 4 * At;
      M.interlaced === !0 && (Ot += 4 * c * 7);
      for (var _t = 8, Pt = 0, Ye = lt[St(157)]; Pt < Ye; ++Pt) {
        var ct = lt[Pt];
        if (jt === 0 && (jt = ht, (z += Ot) >= Xe && (Ot = 4 * At + 4 * c * (_t - 1), z = Oe + (ht + At) * (_t << 1), _t >>= 1)), ct === Lt)
          z += 4;
        else {
          var Qe = o[Ct + 3 * ct], Ke = o[Ct + 3 * ct + 1], $e = o[Ct + 3 * ct + 2];
          D[z++] = Qe, D[z++] = Ke, D[z++] = $e, D[z++] = 255;
        }
        --jt;
      }
    };
  }
})[Ut(147)]()[Ut(150)](/\{([\s\S]*?)\}$/);
const Mn = Ut(160);
function Et(n, t) {
  const e = fe();
  return (Et = function(i, r) {
    return e[i -= 389];
  })(n, t);
}
const O = Et;
function fe() {
  const n = ["1788921ogzkKt", "height", "nodeSetMap", "imageData", "24731LQlMTF", "3936RjzWNh", "width", "1108614RaniJh", "9615738VVFqvT", "removeNode", "11909711AzMUjP", "init", "url", "canvas", "play", "2UIKYGj", "489673rMIRea", "5344656rKpeqO", "createObjectURL", "getCanvas", "ctx", "delete", "call", "getContext", "args", "onmessage", "data", "5ytbdvR", "70JYgaVv"];
  return (fe = function() {
    return n;
  })();
}
(function() {
  const n = Et, t = fe();
  for (; ; )
    try {
      if (-parseInt(n(403)) / 1 + parseInt(n(402)) / 2 * (parseInt(n(394)) / 3) + -parseInt(n(404)) / 4 * (parseInt(n(414)) / 5) + parseInt(n(395)) / 6 + parseInt(n(391)) / 7 * (-parseInt(n(392)) / 8) + -parseInt(n(416)) / 9 * (-parseInt(n(415)) / 10) + parseInt(n(397)) / 11 === 882172)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class En extends ot {
  constructor() {
    const t = Et;
    super(), this.canvasCache = /* @__PURE__ */ new Map(), this[t(389)] = /* @__PURE__ */ new Map(), this[t(398)]();
  }
  [O(406)](t) {
    const e = O;
    let i = this.canvasCache.get(t.imageSrc);
    return i == null ? null : i[e(400)];
  }
  addNode(t) {
    const e = O;
    let i = t.imageSrc, r = e(401), s = this.nodeSetMap.get(i);
    s == null && (s = /* @__PURE__ */ new Set(), this.nodeSetMap.set(i, s), r = "load"), s.add(t), r == "load" ? this.worker.postMessage({ method: r, args: { url: i, basePath: location.href } }) : this.play(i);
  }
  hasNode(t) {
    let e = this.nodeSetMap.get(t.imageSrc);
    return e != null && e.has(t);
  }
  [O(396)](t) {
    const e = O;
    let i = t.imageSrc, r = this.nodeSetMap.get(i);
    r != null && r.size != 0 && (r[e(408)](t), r.size == 0 && this.stop(i));
  }
  [O(401)](t) {
    this.worker.postMessage({ method: "play", args: { url: t } });
  }
  stop(t) {
    this.worker.postMessage({ method: "stop", args: { url: t } });
  }
  onDraw(t) {
    let e = this[O(389)].get(t);
    if (e != null && e.size != 0)
      for (let i of e)
        i.update();
  }
  init() {
    const t = O, e = this, i = new Blob([Mn], { type: "application/javascript" }), r = new Worker(URL[t(405)](i));
    this.worker = r;
    const s = this.canvasCache, l = { onLoad(o) {
      const h = t;
      let a = new ImageData(o.width, o[h(417)]), c = document.createElement(h(400));
      c[h(393)] = o.width, c[h(417)] = o.height;
      let u = c[h(410)]("2d"), f = { canvas: c, ctx: u, imageData: a };
      s.set(o[h(399)], f), e.play(o.url);
    }, draw(o) {
      const h = t;
      let a = s.get(o.url), c = a[h(390)];
      c[h(413)].set(o.pixes), a[h(407)].putImageData(c, 0, 0), e.onDraw(o.url);
    }, onError(o) {
    } };
    r[t(412)] = function(o) {
      const h = t;
      let a = o[h(413)], c = a.method, u = a[h(411)];
      a.time, l[c][h(409)](l, u);
    };
  }
}
const xt = new En();
var tt = ge;
function ge(n, t) {
  var e = me();
  return (ge = function(i, r) {
    return e[i -= 180];
  })(n, t);
}
function me() {
  var n = ["4036esEOZi", "6APsYff", "removeFromParent", "570690ZmqULH", ".gif", "1684970uqqqQK", "removeNode", "260yVVKvG", "3152Ozbski", "_drawImage", "drawImage", "width", "2763IlBacr", "309738ftYHRh", "imageSrc", "addNode", "36943wwSIiQ", "561bqTyBT", "getOwnPropertyDescriptor", "359560zBBxfZ", "hasNode"];
  return (me = function() {
    return n;
  })();
}
(function() {
  for (var n = ge, t = me(); ; )
    try {
      if (parseInt(n(186)) / 1 * (-parseInt(n(192)) / 2) + -parseInt(n(187)) / 3 * (parseInt(n(191)) / 4) + -parseInt(n(189)) / 5 + -parseInt(n(194)) / 6 + -parseInt(n(196)) / 7 + -parseInt(n(199)) / 8 * (-parseInt(n(182)) / 9) + -parseInt(n(198)) / 10 * (-parseInt(n(183)) / 11) === 145817)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var Tn = Object.defineProperty, Sn = Object[tt(188)];
class Fe extends on {
  constructor(t, e = 0, i = 0, r = 1, s = 1) {
    super(t, e, i, r, s);
  }
  [tt(200)](t, e) {
    var i = tt;
    if (xt[i(190)](this)) {
      let r = xt.getCanvas(this);
      if (r != null)
        return void t[i(180)](r, 0.5 * -this.width, 0.5 * -this.height, this[i(181)], this.height);
    } else
      this.imageObject != null && (this.imageSrc.endsWith(i(195)) || this[i(184)].startsWith("data:image/gif")) && xt[i(185)](this);
    t.drawImage(e, 0.5 * -this.width, 0.5 * -this.height, this[i(181)], this.height);
  }
  [tt(193)]() {
    var t = tt;
    return super[t(193)](), xt[t(197)](this), this;
  }
}
function ye(n, t) {
  const e = xe();
  return (ye = function(i, r) {
    return e[i -= 231];
  })(n, t);
}
((n, t, e, i) => {
  for (var r, s = i > 1 ? void 0 : i ? Sn(t, e) : t, l = n.length - 1; l >= 0; l--)
    (r = n[l]) && (s = (i ? r(t, e, s) : r(s)) || s);
  i && s && Tn(t, e, s);
})([R("GifNode")], Fe.prototype, "className", 2), N.regClass("com.jtopo.extensions", "GifNode", Fe);
const m = ye;
function xe() {
  const n = ["5030599gHtwUg", "7890289BfiePQ", "7703856qqhsHf", "forEach", "8ChDKVi", "number", "reset", "hasMark", "faceTo", "direction", "3550340JvdNgi", "back", "10mSDyNM", "object", "onDirectionChanged", "dispatchEvent", "marks", "keys", "46vzKGkf", "1703688YqPyMZ", "moveTo", "9UsEkCU", "hasListener", "atan2", "13041999ggQJOU", "turn", "_direction", "onPositionChanged", "1890WKXtJk", "turnLeft", "getMarks", "turnTo", "args", "getMark", "addMarks", "forward"];
  return (xe = function() {
    return n;
  })();
}
(function() {
  const n = ye, t = xe();
  for (; ; )
    try {
      if (-parseInt(n(264)) / 1 * (-parseInt(n(254)) / 2) + -parseInt(n(257)) / 3 * (parseInt(n(255)) / 4) + -parseInt(n(246)) / 5 + parseInt(n(238)) / 6 + parseInt(n(236)) / 7 * (parseInt(n(240)) / 8) + -parseInt(n(260)) / 9 * (-parseInt(n(248)) / 10) + -parseInt(n(237)) / 11 === 790081)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
const v = { forward: "forward", back: "back", moveTo: "moveTo", mark: "mark", turn: "turn", turnLeft: m(265), turnRight: "turnRight", faceTo: "faceTo", faceToMark: "faceToMark" };
let Cn = Object[m(253)](v);
class at extends qe {
  constructor(t, e) {
    super(t, e);
  }
}
const bt = {};
Cn[m(239)]((n) => {
  bt[n] = new at(n);
});
let Ln = new at("forward"), An = new at("back"), jn = new at(m(261));
class On {
  constructor(t, e, i) {
    const r = m;
    this.x = t, this.y = e, this[r(245)] = i;
  }
}
class _n extends ot {
  constructor() {
    super(), this._x = 0, this._y = 0, this._direction = 0, this.reset();
  }
  onPositionChanged() {
  }
  onDirectionChanged() {
  }
  [m(242)]() {
    return this.x = 0, this.y = 0, this.direction = 0, this.removeAllMarks(), this;
  }
  moveTo(t, e) {
    const i = m;
    return typeof t === i(241) && typeof e == "number" ? (this.x = t, this.y = e) : typeof t == "object" && (this.x = t.x, this.y = t.y), this[i(258)](v.moveTo) && this.dispatchEvent(new at(v[i(256)], { target: this, args: [t, e] })), this;
  }
  forward(t) {
    const e = m;
    return this.x += t * Math.cos(this[e(245)]), this.y += t * Math.sin(this.direction), this.hasListener(v[e(235)]) && this.dispatchEvent(Ln), this;
  }
  [m(247)](t) {
    const e = m;
    this[e(235)](-t), this.hasListener(v[e(247)]) && this.dispatchEvent(An);
  }
  turnTo(t) {
    const e = m;
    return this.direction = t, this.hasListener(v[e(261)]) && this.dispatchEvent(jn), this;
  }
  [m(261)](t) {
    return this.turnTo(this.direction + t);
  }
  turnLeft(t = Math.PI / 2) {
    const e = m;
    return this.turnTo(this[e(245)] - t);
  }
  turnRight(t = Math.PI / 2) {
    return this[m(231)](this.direction + t);
  }
  [m(244)](t, e) {
    const i = m;
    let r;
    typeof t == "number" && typeof e === i(241) ? r = t : typeof t === i(249) && (r = t.x, e = t.y);
    let s = Math[i(259)](e - this.y, r - this.x);
    if (this[i(245)] = s, this.hasListener(v.faceTo)) {
      let l = bt[v.faceTo];
      l.args = arguments[0], this.dispatchEvent(l);
    }
    return this;
  }
  mark(t) {
    const e = m;
    if (t == null)
      throw new Error("mark's name is required.");
    if (this.marks[t] = new On(this.x, this.y, this[e(245)]), this.hasListener(v.mark)) {
      let i = bt[v.mark];
      i[e(232)] = t, this[e(251)](i);
    }
    return this;
  }
  hasMark(t) {
    return this.marks[t] != null;
  }
  getMark(t) {
    let e = this.marks[t];
    if (e == null)
      throw new Error("mark '" + t + "' not found.");
    return e;
  }
  moveToMark(t) {
    let e = this[m(233)](t);
    return this.moveTo(e.x, e.y), this;
  }
  restoreToMark(t) {
    const e = m;
    let i = this[e(233)](t);
    return this[e(256)](i.x, i.y), this.turnTo(i.direction), this;
  }
  removeAllMarks() {
    this.marks = {};
  }
  removeMark(t) {
    return !!this[m(243)](t) && (delete this.marks[t], !0);
  }
  [m(266)]() {
    return this[m(252)];
  }
  [m(234)](t) {
    const e = m;
    for (let i in t)
      this[e(252)][i] = t[i];
  }
  get x() {
    return this._x;
  }
  set x(t) {
    t != this._x && (this._x = t, this.onPositionChanged());
  }
  get y() {
    return this._y;
  }
  set y(t) {
    const e = m;
    t != this._y && (this._y = t, this[e(263)]());
  }
  get [m(245)]() {
    return this[m(262)];
  }
  set direction(t) {
    const e = m;
    t != this[e(262)] && (this._direction = t, this[e(250)]());
  }
}
const T = _;
function _(n, t) {
  const e = we();
  return (_ = function(i, r) {
    return e[i -= 251];
  })(n, t);
}
(function() {
  const n = _, t = we();
  for (; ; )
    try {
      if (-parseInt(n(256)) / 1 * (-parseInt(n(262)) / 2) + parseInt(n(261)) / 3 + parseInt(n(272)) / 4 + parseInt(n(277)) / 5 + -parseInt(n(264)) / 6 * (parseInt(n(282)) / 7) + parseInt(n(254)) / 8 * (parseInt(n(274)) / 9) + parseInt(n(253)) / 10 * (-parseInt(n(258)) / 11) === 947474)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Pn {
  constructor(t) {
    this[_(268)] = 1e3, this.defaultEffect = "easeLinear", this.defaultAnimationOptions = { duration: 1e3, effect: "easeLinear" }, this.topo = t, this.animation = new P();
  }
  setTopoAnimationOptions(t) {
    const e = _;
    this[e(270)].duration = t.duration || 1e3, this.defaultAnimationOptions[e(280)] = t.effect || e(279);
  }
  moveTo(t, e, i) {
    const r = _;
    let s, l = this.topo;
    if (typeof t == "number" && typeof e == "number")
      s = { x: t, y: e };
    else {
      if (typeof t !== r(281) || t.x == null || t.y == null)
        throw new Error("invalid arguments moveTo");
      s = { x: t.x, y: t.y }, i = e;
    }
    return i == null && (i = this.defaultAnimationOptions), this[r(271)](v.moveTo, s, [l.x, l.y], [s.x, s.y], (o) => {
      l.x = o[0], l.y = o[1];
    }, i);
  }
  faceTo(t, e, i) {
    const r = _;
    let s, l = this.topo;
    if (typeof t == "number" && typeof e == "number")
      s = { x: t, y: e };
    else {
      if (typeof t !== r(281) || t.x == null || t.y == null)
        throw new Error("invalid arguments faceTo");
      s = { x: t.x, y: t.y }, i = e;
    }
    i == null && (i = this.defaultAnimationOptions);
    const o = l.direction;
    let h = Math.atan2(s.y - l.y, s.x - l.x), a = h - o;
    return a > Math.PI ? h = o - (2 * Math.PI - a) : a < -Math.PI && (h = o + (2 * Math.PI + a)), this[r(271)](v.faceTo, s, [o], [h], (c) => {
      l.direction = c[0];
    }, i);
  }
  [T(275)](t, e) {
    const i = T;
    let r = this[i(266)];
    const s = r.x + t * Math[i(265)](r[i(267)]), l = r.y + t * Math[i(278)](r.direction);
    return this[i(271)](v.forward, t, [r.x, r.y], [s, l], (o) => {
      r.x = o[0], r.y = o[1];
    }, e);
  }
  back(t, e) {
    return this.forward(-t, e);
  }
  [T(257)](t, e) {
    const i = T;
    let r = this.topo;
    const s = r[i(267)], l = s + t;
    return this._anime(v.turn, t, [s], [l], (o) => {
      r[i(267)] = o[0];
    }, e);
  }
  [T(273)](t = Math.PI / 2, e) {
    return this.turn(-t, e);
  }
  [T(269)](t = Math.PI / 2, e) {
    return this.turn(t, e);
  }
  turnTo(t, e) {
    let i = this.topo;
    const r = i.direction;
    return this._anime(v.turn, t, [r], [t], (s) => {
      i[_(267)] = s[0];
    }, e);
  }
  moveToMark(t, e) {
    const i = this.topo.getMark(t);
    return this.moveTo(i, e);
  }
  [T(255)](t, e) {
    const i = T, r = this.topo.getMark(t);
    return this[i(252)](r, e);
  }
  restoreToMark(t, e) {
    const i = T, r = this[i(266)].getMark(t), s = this.moveTo(r, e), l = this.turnTo(r.direction, e);
    return Promise[i(260)]([s, l]);
  }
  [T(271)](t, e, i, r, s, l) {
    const o = T;
    l == null && (l = this.defaultAnimationOptions);
    let h = this.topo, a = this.animation;
    return a.setAttributes({ from: i, to: r, update: (c) => {
      s(c);
    }, duration: l[o(259)] || this[o(268)], effect: l[o(280)] || this[o(251)] }), a.play()[o(263)](() => {
      if (h.hasListener(t)) {
        let c = bt[t];
        c.args = e, h.dispatchEvent(c);
      }
    });
  }
  abort() {
    const t = T;
    return this.animation && this.animation[t(276)](), this;
  }
}
function we() {
  const n = ["1091PNoAfX", "turn", "22VgyEQx", "duration", "all", "4144629qVlVtc", "1838FlXqqU", "then", "36132gszoHF", "cos", "topo", "direction", "defaultDuration", "turnRight", "defaultAnimationOptions", "_anime", "4190424ByiFic", "turnLeft", "9dCKWuS", "forward", "cancel", "4484330sWkjGR", "sin", "easeLinear", "effect", "object", "1841pUPNrg", "defaultEffect", "faceTo", "18166490PQydZj", "14687312jfvNYv", "faceToMark"];
  return (we = function() {
    return n;
  })();
}
const S = V;
function be() {
  const n = ["12FgaeBx", "6rSXzUD", "_stageRef", "664GauWTq", "sqrt", "10rWsWQX", "object", "concat", "map", "8868ktjISW", "28URMuNc", "sin", "duration", "effect", "throw", "direction", "1139635UQVVUw", "setBody", "add", "putDown", "rotate", "reset", "invalid arguments throwTo", "includes", "424010VesDRG", "359392oBjtdh", "atan2", "play", "cancel", "2669029zyBBVW", "isNaN", "animationSystem", "139594EpNCTA", "147330ovYVmH", "defaultAnimationOptions", "carriedObjects", "push", "setXY", "animator", "animation", "number", "body", "indexOf", "topo"];
  return (be = function() {
    return n;
  })();
}
function V(n, t) {
  const e = be();
  return (V = function(i, r) {
    return e[i -= 472];
  })(n, t);
}
(function() {
  const n = V, t = be();
  for (; ; )
    try {
      if (-parseInt(n(507)) / 1 + -parseInt(n(515)) / 2 + parseInt(n(492)) / 3 * (parseInt(n(486)) / 4) + parseInt(n(499)) / 5 * (parseInt(n(484)) / 6) + -parseInt(n(493)) / 7 * (parseInt(n(508)) / 8) + -parseInt(n(472)) / 9 * (parseInt(n(488)) / 10) + -parseInt(n(512)) / 11 * (-parseInt(n(483)) / 12) === 271389)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Fn extends _n {
  constructor(t) {
    const e = V;
    super(), this.carriedObjects = [], this[e(477)] = new Nn(this), this._stageRef = t, t[e(514)].add(this.animator[e(478)]);
  }
  onPositionChanged() {
    const t = V;
    for (let e = 0; e < this.carriedObjects.length; e++)
      this.carriedObjects[e].setXY(this.x, this.y);
    this[t(480)] && this.body[t(476)](this.x, this.y);
  }
  onDirectionChanged() {
    const t = V;
    for (let e = 0; e < this[t(474)].length; e++)
      this.carriedObjects[e][t(503)](this[t(498)]);
    this[t(480)] && this.body.rotate(this[t(498)]);
  }
  [S(500)](t) {
    return this.body = t, this;
  }
  carry(t) {
    const e = S;
    return Array.isArray(t) ? this[e(474)] = this.carriedObjects[e(490)](t) : this.carriedObjects[e(475)](t), this;
  }
  throw(t, e = 0, i = 0) {
    const r = S;
    let s = this.x, l = this.y;
    if ((i > 0 || e != 0) && (s += i * Math.cos(this.direction + e), l += i * Math.sin(this[r(498)] + e)), this.carriedObjects[r(506)](t)) {
      t.x = s, t.y = l;
      let o = this[r(474)].indexOf(t);
      this[r(474)].splice(o, 1);
    }
    return this;
  }
  throwTo(t, e, i) {
    const r = S;
    if (typeof e == "number" && typeof i == "number") {
      let s = Math[r(509)](i - this.y, e - this.x) - this.direction, l = Math[r(487)]((e - this.x) ** 2 + (i - this.y) ** 2);
      return this.throw(t, s, l);
    }
    if (typeof e == "object") {
      let s = Math.atan2(e.y - this.y, e.x - this.x) - this.direction, l = Math.sqrt((e.x - this.x) ** 2 + (e.y - this.y) ** 2);
      return this.throw(t, s, l);
    }
    throw new Error(r(505));
  }
  [S(502)](t) {
    if (this.carriedObjects.includes(t)) {
      t.x = this.x, t.y = this.y;
      let e = this.carriedObjects.indexOf(t);
      this.carriedObjects.splice(e, 1);
    }
    return this;
  }
  reset() {
    const t = S;
    return super[t(504)](), this.animator && this[t(477)].animation && this.animator.animation[t(511)](), this;
  }
}
class Nn extends Pn {
  constructor(t) {
    super(t);
  }
  carry(t, e) {
    const i = S;
    let r = this[i(482)];
    r.carry(t);
    let s = Array.isArray(t) ? t : [t], l = s[i(491)]((a) => [a.x, a.y, a.rotation]), o = s[i(491)]((a) => [r.x, r.y, r.direction]);
    e == null && (e = this.defaultAnimationOptions);
    let h = new P();
    return h.setAttributes({ from: l.flat(), to: o.flat(), duration: e.duration || this.defaultAnimationOptions[i(495)], effect: e[i(496)], update: (a) => {
      if (Number[i(513)](a[0]))
        throw new Error("args[0] is NaN");
      for (let c = 0; c < s.length; c++)
        s[c].x = a[3 * c], s[c].y = a[3 * c + 1], s[c].rotation = a[3 * c + 2];
    } }), this.topo._stageRef.animationSystem.add(h), h[i(510)]();
  }
  [S(497)](t, e = 0, i = 0, r) {
    const s = S;
    let l = this[s(482)];
    if (!l.carriedObjects.includes(t))
      throw new Error("object is not in carriedObjects");
    r == null && (r = this.defaultAnimationOptions);
    let o = l.x, h = l.y;
    i > 0 && (o += i * Math.cos(l[s(498)] + e), h += i * Math[s(494)](l.direction + e)), e != 0 && (o += i * Math.cos(l.direction + e), h += i * Math.sin(l.direction + e));
    let a = new P();
    a.setAttributes({ from: [l.x, l.y], to: [o, h], duration: r[s(495)], effect: r[s(496)], update: (u) => {
      t.x = u[0], t.y = u[1];
    } }), this.topo._stageRef.animationSystem[s(501)](a);
    let c = l.carriedObjects[s(481)](t);
    return this.topo[s(474)].splice(c, 1), a.play();
  }
  throwTo(t, e, i, r) {
    const s = S;
    let l, o = this[s(482)];
    if (typeof e == "number" && typeof i === s(479))
      l = { x: e, y: i };
    else {
      if (typeof e !== s(489) || e.x == null || e.y == null)
        throw new Error("invalid arguments throwTo");
      l = { x: e.x, y: e.y }, r = i;
    }
    r == null && (r = this[s(473)]);
    let h = new P();
    h.setAttributes({ from: [o.x, o.y], to: [l.x, l.y], duration: r[s(495)], effect: r[s(496)], update: (c) => {
      t.x = c[0], t.y = c[1];
    } }), this.topo._stageRef.animationSystem[s(501)](h);
    let a = o.carriedObjects.indexOf(t);
    return this.topo.carriedObjects.splice(a, 1), h.play();
  }
  [S(502)](t, e) {
    const i = S;
    let r = this.topo;
    r.putDown(t), e == null && (e = this.defaultAnimationOptions);
    let s = new P();
    return s.setAttributes({ from: [t.x, t.y], to: [r.x, r.y], duration: e.duration, effect: e.effect, update: (l) => {
      t.x = l[0], t.y = l[1];
    } }), this[i(482)][i(485)].animationSystem.add(s), s.play();
  }
}
function ve() {
  const n = ["appendChild", "483wktsuN", "527710TMflCU", "6VKrGJI", "1350684zPVWzP", "57894ETkcuR", "5654008uiTakz", "style", "1163206jAYRpT", "17237727phNdwU", "9982TQOmvi"];
  return (ve = function() {
    return n;
  })();
}
function Gt(n, t) {
  const e = ve();
  return (Gt = function(i, r) {
    return e[i -= 318];
  })(n, t);
}
(function() {
  const n = Gt, t = ve();
  for (; ; )
    try {
      if (parseInt(n(324)) / 1 + parseInt(n(322)) / 2 + -parseInt(n(328)) / 3 * (parseInt(n(318)) / 4) + -parseInt(n(327)) / 5 + -parseInt(n(319)) / 6 * (parseInt(n(326)) / 7) + -parseInt(n(320)) / 8 + parseInt(n(323)) / 9 === 353472)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), function() {
  const n = Gt;
  let t = document.head || document.getElementsByTagName("head")[0], e = document.getElementById("_jtopo_style_");
  e == null && (e = document.createElement(n(321)), e.id = "_jtopo_style_", e.textContent = `.jtopo_popoupmenu{padding:10px;border-radius:5px;min-width:210px;background-color:#fff;border:1px solid;position:absolute;z-index:10000}.jtopo_popoupmenu .header{font-size:14px;height:24px;padding-bottom:3px}.jtopo_popoupmenu a{text-rendering:optimizeLegibility;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding-left:20px;display:block;height:25px;color:#00000080;font-size:13px;cursor:pointer}.jtopo_popoupmenu a:hover{color:#000}.jtopo_iconsPanel{opacity:.98;padding:3px;position:absolute;background-color:#e8e8e8;top:20px;width:52px;z-index:1000;border-radius:5px}.jtopo_iconsPanel .item{border:1px solid white;width:42px;height:42px;margin:4px 2px 0}.jtopo_toolbar{border-bottom:1px dotted;padding-bottom:2px;border-color:#e0e0e0;width:100%;min-height:33px;background-color:#e8e8e8}.jtopo_toolbar .group{float:left;margin-right:5px}.jtopo_toolbar .item{float:left;width:32px;height:32px;stroke:gray;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;fill:none;font-size:12px;color:gray}.jtopo_toolbar .active{background-color:#d3d3d3;border:1px solid black}.jtopo_toolbar input[type=text]{font-size:12px;color:gray;float:left;width:120px;height:26px;border:1px solid white;margin:2px 2px 2px 4px}.jtopo_input_textfield{position:absolute;display:none;font-size:smaller;z-index:10000;border:1px gray dotted;padding:0;margin:0;word-break:none;word-wrap:none;outline:none;box-shadow:0 0 5px #0000ff80;overflow:hidden;resize:none}.jtopo_tooltip{pointer-events:none;opacity:.9;min-width:30px;min-height:30px;padding:10px;border-radius:5px;background-color:#f8f8f8;border:1px solid;position:absolute;z-index:10000}.jtopo_debugPanel{-webkit-user-select:none;user-select:none;border:dashed 1px gray;padding:8px;position:absolute;left:0;top:0%;width:300px;z-index:98;text-align:left;font-size:14px;color:gray}
`, t[n(325)](e));
}();
export {
  Dn as AssetsLoader,
  He as BlinkingArrowNode,
  Fe as GifNode,
  Wn as InputTextfield,
  Ne as InputTextfieldEvent,
  ze as JointLNode,
  Bn as PopupMenu,
  Ft as RatioNode,
  Re as RipplingNode,
  Rn as Toolbar,
  Hn as Tooltip,
  Fn as TopoRobot,
  We as WaterLikeNode
};
